<?
session_start();
if (!isset($_SESSION[login])) {
     header("Location: HomeIndex.php");
     exit;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Manage Project Student</title>
<link rel="stylesheet" href="style.css" type="text/css" />
<SCRIPT LANGUAGE="JavaScript">
function chkData(text){ 
tmp =document.all.item("text").value;
if (tmp != "")
searchpro.submit();
else {
alert("Enter Name");
document.all.item("text").focus();
searchpro.submit(); 
}
}
</SCRIPT>
<meta charset="utf-8">
<meta name="description" content="Place your description here">
<meta name="keywords" content="put, your, keyword, here">
<meta name="author" content="Templates.com - website templates provider">
<link rel="stylesheet" href="css/reset.css" type="text/css" media="all">
<link rel="stylesheet" href="css/style.css" type="text/css" media="all">
<script type="text/javascript" src="js/jquery-1.4.2.min.js" ></script>
<script type="text/javascript" src="js/cufon-yui.js"></script>
<script type="text/javascript" src="js/script.js"></script>
<!--[if lt IE 7]>
     <link rel="stylesheet" href="css/ie/ie6.css" type="text/css" media="screen">
     <script type="text/javascript" src="js/ie_png.js"></script>
     <script type="text/javascript">
        ie_png.fix('.png, footer, header nav ul li a, .nav-bg, .list li img');
     </script>
<![endif]-->
<!--[if lt IE 9]>
  	<script type="text/javascript" src="js/html5.js"></script>
  <![endif]-->
</head>
<body id="page1">
<div class="wrap">
   <!-- header -->
   <header>
      <div class="container">
         <h1><a href="homeStudent.php">Student Portfolio Management System</a></h1>
         <nav>
            <ul>
               <li class="current"><a href="homeStudent.php" class="m1">หน้าแรก</a></li>
               <li><a href="searchStudent.php" class="m1">ค้นหา</a></li>
               <li><a href="uploadStudent.php" class="m1">อัพโหลด</a></li>
               <li class="last"><a href="reportStudent.php" class="m3">ออกรายงาน</a></li>
            </ul>
         </nav>
         <form action="" id="search-form">
            <fieldset>
            <div class="rowElem">
               <input type="text">
               <a href="#" onClick="document.getElementById('search-form').submit()">ค้นหา</a></div>
            </fieldset>
         </form>
      </div>
   </header>
   <div class="container">
      <!-- aside -->
      <aside>
         <div class="wrap">
   <!-- header -->
   <div class="container">
      <!-- aside -->
      <aside><h2 align ="left">ยินดีต้อนรับ</h2> 
	   <p><? echo $_SESSION["ses_name"]; ?></p>
     <input name="editSelf" type="button" value="แก้ไขข้อมูลส่วนตัว" onClick="window.location='editselfStudent.php'"><br><br>
	 <input name="manage" type="button" value="แก้ไขข้อมูลผลงาน" onClick="window.location='manageProjectStudent.php'"><br><br>
      <input name="logOut" type="button" value="ออกจากระบบ" onClick="window.location='logout.php'">
</aside>	 
      <!-- content -->
      <section id="content">   
         <div class="inside">       
         </div>
      </section>
   </div>
</div>
      </aside>
      <!-- content -->
      <section id="content">
       <div class="inside">
       <p class="style30">ระบบจัดการผลงานนักศึกษา</p>
        <hr />
  <table width="800" height="10" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td height="39" colspan="4">
        <p>&nbsp;</p></td>
    </tr>
  </table>
</div>
  <table width="650" height="70" border="1" cellpadding="5" cellspacing="0" bordercolor="#999999">
    <tr>
      <td width="100" height="40" bgcolor="#C2CFDF" valign="middle"><div align="center" class="style29">ชื่อผลงาน</div></td>
      <td width="80" bgcolor="#C2CFDF" valign="middle"><div align="center" class="style29">ประเภทผลงาน</div></td>
      <td width="50" bgcolor="#C2CFDF" valign="middle"><div align="center" class="style29">สถานะ</div></td>
      <td width="75" bgcolor="#C2CFDF" valign="middle"><div align="center" class="style29">แก้ไขข้อมูล</div></td>
      <td width="60" bgcolor="#C2CFDF" valign="middle"><div align="center" class="style29">
        <div align="center">ลบข้อมูล</div>
      </div></td>
    </tr>
<? require("connectDB.php");    //include "connectdb.inc";

$tmp="select * from project where user_id='".$_SESSION["ses_id"]."' order by project_id;";

//echo($tmp);
$sql = mysql_query($tmp);
while($result = mysql_fetch_array($sql))    { ?>
<TR>
<TD><? echo $result["project_name"]; ?></TD>
<td align="center"><? echo $result["project_type"]; ?></td>
<td><? echo $result["project_status"];?></td>
<TD align="center"> <a href="edituploadStudent.php?id=<? echo $result["project_id"]; ?>" >แก้ไข</TD>
<TD align="center"> <a href="deleteProjectStudent.php?id=<? echo $result["project_id"]; ?>" >ลบ</TD>
</tr>
<? }
mysql_free_result($sql);
mysql_close($con); ?>
</table>
         </div>
</body>
</html>
